package desperte.aqui;

/*
 * main.java
 * Purpose: A execução do app começa aqui.
 * 
 * @author Thassio Carvalho <tvmcarvalho@gmail.com>
 * @revision 0.23 19/05/2012
 */

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

public class main extends ListActivity{
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
 
        String[] itensMenu = {"Novo alarme", "Perfis salvos", "Histórico"
        		,"Sobre", "Segundo plano", "Sair" };
        
        ArrayAdapter<String> adapterMenu = new ArrayAdapter<String>(this, 
        		android.R.layout.simple_expandable_list_item_1, itensMenu);
        
        setListAdapter(adapterMenu);
            
    }

	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		// TODO Auto-generated method stub
	super.onListItemClick(l, v, position, id);
		String item = (String)getListAdapter().getItem(position);
		Toast.makeText(this, item + " selecionado", Toast.LENGTH_LONG).show();
		
		if(item.equalsIgnoreCase("novo alarme"))
		{
			Intent nvAlarm = new Intent(main.this, AlarmMisc.class);
			main.this.startActivity(nvAlarm);
				}
			else if(item.equalsIgnoreCase("perfis salvos")){
				/*
				 *Intent nvAlarm = new Intent(main.this, AlarmMisc.class);
				 *main.this.startActivity(nvAlarm);
				 */
						}
				else if(item.equalsIgnoreCase("histórico")){
					/*
					 *Intent nvAlarm = new Intent(main.this, AlarmMisc.class);
					 *main.this.startActivity(nvAlarm);
					 */
							}
					else if(item.equalsIgnoreCase("sobre")){
						/*
						 *Intent nvAlarm = new Intent(main.this, AlarmMisc.class);
						 *main.this.startActivity(nvAlarm);
						 */
								}
						else if(item.equalsIgnoreCase("segundo plano")){
							/*
							 *Intent nvAlarm = new Intent(main.this, AlarmMisc.class);
							 *main.this.startActivity(nvAlarm);
							 */
									}
							else if(item.equalsIgnoreCase("sair")){
									finish();
										}
	}//Fim do método 'onListItemClick()'

	
	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
	}
}